package Test;
public class JBT5301 {
    public static void main(String[] args) {
        MyArray my1=new MyArray();
        char ch='*';
        char[] chest={'a','b','c','*'};
        String strarr=new String(chest);
        System.out.println(strarr);
        System.out.println(strarr+"中字符"+ch+"的个数为"+my1.countChar(strarr,ch));
    }
}
class MyArray{
    public int countChar(String str,char ch){
        int i,j=0;
        for(i=0;i<str.length();i++)
            if(str.charAt(i)==ch)j=j+1;
        return j+1;
    }
}